package messangerTypes;

@SuppressWarnings("serial")
public class ConnectResponse extends MessageBase implements java.io.Serializable
{

	public static enum ResponseCode {ACCEPTED, REVOKED};
	private ResponseCode response;
	private User requestingUser;
	private User requestedUser;
	private boolean login = false;
	

	public ResponseCode getResponse()
	{
		return response;
	}

	@Override
	public String toString()
	{
		return "ConnectResponse [response=" + response + ", requestingUser="
				+ requestingUser + ", requestedUser=" + requestedUser
				+ ", login=" + login + "]";
	}

	public ConnectResponse(ResponseCode code, User requesting)
	{
		super(MessageBase.MessageType.CONNECT_RESPONSE);
		this.requestingUser = requesting;
		this.response = code;
		this.login = true;
	}
	
	public ConnectResponse(ResponseCode code, User requesting, User requested)
	{
		super(MessageBase.MessageType.CONNECT_RESPONSE);
		this.requestingUser = requesting;
		this.requestedUser = requested;
		this.response = code;
		this.login = false;
	}
	
	public User getRequestingUser()
	{
		return requestingUser;
	}

	public User getRequestedUser()
	{
		return requestedUser;
	}

	public boolean isLogin()
	{
		return login;
	}

}
